import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/ServiceAuthApi/connect/token',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}

export function getInfo(token) {
  return request({
    url: '/ServiceAuthApi/api/User/QueryUserInfo',
    method: 'get',
  })
}

export function logout() {
  return request({
    url: '/vue-admin-template/user/logout',
    method: 'post'
  })
}



export function queryUserPages(data) {
  return request({
    url: '/ServiceAuthApi/api/User/QueryUserPages',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'application/json'
    },
  })
}
export function queryUserById(params) {
  return request({
    url: '/ServiceAuthApi/api/User/QueryUserById',
    method: 'get',
    params
  })
}


export function changeUserPwd(data) {
  return request({
    url: '/ServiceAuthApi/api/User/ChangeUserPwd',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'application/json'
    },
  })
}


export function deleteUser(data) {
  return request({
    url: '/ServiceAuthApi/api/User/DeleteUser',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'application/json'
    },
  })
}

export function updateUser(data) {
  return request({
    url: '/ServiceAuthApi/api/User/UpdateUser',
    method: 'put',
    data,
    headers: {
      'Content-Type': 'application/json'
    },
  })
}

export function createUser(data) {
  return request({
    url: '/ServiceAuthApi/api/User/CreateUser',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'application/json'
    },
  })
}





